/*
 * UserData.java
 *
 * Created on March 31, 2007, 6:38 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package busticketvendingsystem;

/**
 *
 * @author Samik Saha
 */
public class UserData {
    /**
     * The direction may be UP or DOWN. UP is assigned a value 1 and DOWN 0
     */
    private int direction;
    /**
     * The no of tickets one passenger buys at a time.
     */
    private int noTickets;
    /**
     * ticketType specifies if the user is buying regular or seasonal tickets.
     * ticketType can have the values REGULAR=0; MONTHLY=1; QUARTERLY=2 and
     * YEARLY=3.
     */
    private int ticketType;
    /**
     * concession specifies if the passenger wiil take concession. concession
     * may have the following four values-
     * NO_CONCESSION=0; STUDENT=1; PHYSICALLY_DISABLED=2; SENIOR_CITIZEN=3
     */
    private int concessionType;
    private float amount;
    private String date;
    private String startingStop;
    private String endStop;
    private float distance;
    private String busNo;
    private int availableSeats;
    private String scheduleTime;
    private String ticketId;
    
    public static final int UP=1,DOWN=0;
    public static final int REGULAR=0, MONTHLY=1, QUARTERLY=2, YEARLY=3;
    public static final int NO_CONCESSION=0, STUDENT=1, PHYSICALLY_DISABLED=2, SENIOR_CITIZEN=3;
    
    /** Creates a new instance of UserData */
    public UserData() {
        direction=UP;
        noTickets=1;
        ticketType=REGULAR;
        concessionType=NO_CONCESSION;
        startingStop="Garia";
        endStop="Howrah Station";
        distance=32;
        busNo="WB11 7890";
        availableSeats=52;
        scheduleTime="0:00";
        amount=4;
        date="2001-01-01";
        ticketId="200704030001";
    }
    public void setDirection(int dir){
        if (dir==1 || dir==0)
            direction=dir;
    }
    public void setNoTickets(int n){
        if(n>0 && n<52)
            noTickets=n;
    }
    public void setTicketType(int t){
        if(t>=0 && t<=3)
            ticketType=t;
    }
    public void setConcessionType(int c){
        if(c>=0 && c<=3)
            concessionType=c;
    }
    public void setDistance(float dist){
        if(dist>=0 && dist<100)
            distance=dist;
    }
    public void setBusNo(String bn){
        busNo=bn;
    }
    public void setStartingStop(String sStop){
        startingStop=sStop;
    }
    public void setDestination(String dStop){
        endStop=dStop;
    }
    public void setAvailableSeats(int availSeats){
        if(availSeats>=0 && availSeats<52)
            availableSeats=availSeats;
    }
    public void setScheduleTime(String schTime){
        scheduleTime=schTime;
    }
    public void setAmount(float amnt){
        amount=amnt;
    }
    public void setDate(String dt){
        date=dt;
    }
    public void setTicketId(String id){
        ticketId=id;
    }
    
    
    
    
    
    
    
    public int getDirection(){
        return direction;
    }
    public String getDirectionName(){
        return (direction==1)?"Up":"Down";
    }
    public int getNoTickets(){
        return noTickets;
    }
     public int getTicketType(){
        return ticketType;
    }
    public String getTicketTypeName(){
        if(ticketType==0)
            return "Regular";
        else if(ticketType==1)
            return "Monthly";
        else if(ticketType==2)
            return "Quarterly";
        else
            return "Yearly";
    }
    public int getConcessionType(){
            return concessionType;
    }
    public String getConcessionTypeName(){
        if(concessionType==0)
            return "No Concession";
        else if(concessionType==1)
            return "Student";
        else if(concessionType==2)
            return "Physically Disabled";
        else
            return "Senior Citizen";
    }
    public float getDistance(){
        return distance;
    }
    public String getBusNo(){
        return busNo;
    }
    public String getStartingStop(){
        return startingStop;
    }
    public String getDestination(){
        return endStop;
    }
    public int getAvailableSeats(){
            return availableSeats;
    }
    public String getScheduleTime(){
        return scheduleTime;
    }
    public float getAmount(){
        return amount;
    }
    public String getDate(){
        return date;
    }
    public String getTicketId(){
        return ticketId;
    }
}
